home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 693 b | 29 lines | [TEXT/CWIE] |
-
- #include "CMD_Fade.h"
-
- // Fade a bitmap
- // assumes 32 bits per pixel.
- void md_vectorFade(unsigned long *pBase, short boxHeight, unsigned long widthInPixels, unsigned long rowBytes)
- {
- if ((unsigned long)pBase % 16)
- DebugStr((const unsigned char *)"\pmd_vectorFade requires 16-byte alignment.");
-
- vector unsigned char *vp;
- vector unsigned char fourty = (vector unsigned char)(40);
-
- vector unsigned char *pRow = (vector unsigned char *)pBase;
- unsigned long width = widthInPixels / 4;
- unsigned long rowVecs = rowBytes / 16;
-
- for (int i = 0; i < boxHeight; i++)
- {
- vp = pRow;
- for (int j = 0; j < width; j++)
- {
- *vp = vec_adds(*vp, fourty);
- vp++;
- }
- pRow += rowVecs;
- }
- }
-